home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 3
/
Amoszine 3.adf
/
Celebrity_source
/
block_appear.AMOS
/
block_appear.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1992-02-26
|
3KB
|
95 lines
' *************************************************************
'
' Block Appear Program
'
' - ** By Paul Nordovics ** -
'
' If you use this in your own programs I won't be offended if
' you mention me in your creditz !!!
' *************************************************************
'
' Similar FX Have Been Done Before But This Allows U To Specify
' An Area Of Screen And Size Of Block - who could ask 4 more !
'
' BLOCK_APPEAR[source,sx1,sy1,sx2,sy2,dest,dx,dy,block_width,block_height,speed]
'
' source = screen number where source image is
' sx1,sy1 = co-ords of top-left corner of source image
' sx2,sy2 = co-ords of bottom-right corner of source image
' dest = screen number where image is being copied to
' dx,dy = co-ords of top-left corner where image will be copied to
' block_width = width of block to be copied each step
' block_height = height of block to be copied each step
' speed = speed of copy fx
'
' *************************************************************
'
' ********************
' set up source screen
' ********************
Screen Open 0,320,256,16,Lowres
Curs Off : Flash Off : Hide
Unpack 1 To 0
'
' *************************
' set up destination screen
' *************************
Screen Open 1,320,256,16,Lowres
Curs Off : Flash Off
Screen Display 1,128,45,,
Cls 0 : Paper 0
'
' *********************
' set up simple rainbow
' *********************
Set Rainbow 0,1,142,"","",""
For K=0 To 141
F#=K/141.0
Rain(0,K)=$F00+(F#*$F)
Next K
Rainbow 0,0,48+45,143
'
' **************
' wait for input
' **************
Locate ,10 : Centre "- ** Press A Key ** -"
Wait Key
'
' ****
' loop
' ****
Do
Cls 0
' *************************************
' get random width and height for block
' *************************************
W=2^(Rnd(3)+1)
H=2^(Rnd(2)+1)
'
For K=0 To 9
BLOCK_APPEAR[0,98,(K*15)+48,226,(K*15)+56,1,98,(K*15)+48,W,H,1]
Next K
Wait 100
Loop
'
Procedure BLOCK_APPEAR[SOURCE,SX1,SY1,SX2,SY2,DEST,DX,DY,BLOCK_WIDTH,BLOCK_HEIGHT,SPEED]
AREA_LENGTH=SX2-SX1
AREA_HEIGHT=SY2-SY1
AMOUNT_X=(AREA_LENGTH/BLOCK_WIDTH)
AMOUNT_Y=(AREA_HEIGHT/BLOCK_HEIGHT)
NUMBER=AMOUNT_X*AMOUNT_Y
Dim CLEAR_FLAG(AMOUNT_X,AMOUNT_Y)
COUNT=0
Repeat
X=Rnd(AMOUNT_X) : If X>0 Then X=X-1
Y=Rnd(AMOUNT_Y) : If Y>0 Then Y=Y-1
If CLEAR_FLAG(X,Y)=0
Screen Copy SOURCE,SX1+(X*BLOCK_WIDTH),SY1+(Y*BLOCK_HEIGHT),SX1+(X*BLOCK_WIDTH)+BLOCK_WIDTH,SY1+(Y*BLOCK_HEIGHT)+BLOCK_HEIGHT To DEST,DX+(X*BLOCK_WIDTH),DY+(Y*BLOCK_HEIGHT)
CLEAR_FLAG(X,Y)=1
Inc COUNT
If SPEED>0
Wait SPEED
End If
End If
Until COUNT=NUMBER
End Proc